import 'package:chat_app_project/generated/json/base/json_convert_content.dart';
import 'package:chat_app_project/models/demand_entity.dart';

DemandEntity $DemandEntityFromJson(Map<String, dynamic> json) {
	final DemandEntity demandEntity = DemandEntity();
	final int? bids = jsonConvert.convert<int>(json['bids']);
	if (bids != null) {
		demandEntity.bids = bids;
	}
	final DemandCircleVo? circleVo = jsonConvert.convert<DemandCircleVo>(json['circleVo']);
	if (circleVo != null) {
		demandEntity.circleVo = circleVo;
	}
	final String? closeTime = jsonConvert.convert<String>(json['closeTime']);
	if (closeTime != null) {
		demandEntity.closeTime = closeTime;
	}
	final int? collections = jsonConvert.convert<int>(json['collections']);
	if (collections != null) {
		demandEntity.collections = collections;
	}
	final String? completeTime = jsonConvert.convert<String>(json['completeTime']);
	if (completeTime != null) {
		demandEntity.completeTime = completeTime;
	}
	final String? content = jsonConvert.convert<String>(json['content']);
	if (content != null) {
		demandEntity.content = content;
	}
	final String? createTime = jsonConvert.convert<String>(json['createTime']);
	if (createTime != null) {
		demandEntity.createTime = createTime;
	}
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		demandEntity.id = id;
	}
	final List<dynamic>? labels = jsonConvert.convertListNotNull<dynamic>(json['labels']);
	if (labels != null) {
		demandEntity.labels = labels;
	}
	final int? lat = jsonConvert.convert<int>(json['lat']);
	if (lat != null) {
		demandEntity.lat = lat;
	}
	final int? likes = jsonConvert.convert<int>(json['likes']);
	if (likes != null) {
		demandEntity.likes = likes;
	}
	final int? lng = jsonConvert.convert<int>(json['lng']);
	if (lng != null) {
		demandEntity.lng = lng;
	}
	final List<dynamic>? loc = jsonConvert.convertListNotNull<dynamic>(json['loc']);
	if (loc != null) {
		demandEntity.loc = loc;
	}
	final String? location = jsonConvert.convert<String>(json['location']);
	if (location != null) {
		demandEntity.location = location;
	}
	final int? memberId = jsonConvert.convert<int>(json['memberId']);
	if (memberId != null) {
		demandEntity.memberId = memberId;
	}
	final DemandMemberInfo? memberInfo = jsonConvert.convert<DemandMemberInfo>(json['memberInfo']);
	if (memberInfo != null) {
		demandEntity.memberInfo = memberInfo;
	}
	final int? money = jsonConvert.convert<int>(json['money']);
	if (money != null) {
		demandEntity.money = money;
	}
	final String? number = jsonConvert.convert<String>(json['number']);
	if (number != null) {
		demandEntity.number = number;
	}
	final List<String>? pics = jsonConvert.convertListNotNull<String>(json['pics']);
	if (pics != null) {
		demandEntity.pics = pics;
	}
	final int? realDistance = jsonConvert.convert<int>(json['realDistance']);
	if (realDistance != null) {
		demandEntity.realDistance = realDistance;
	}
	final String? releaseTime = jsonConvert.convert<String>(json['releaseTime']);
	if (releaseTime != null) {
		demandEntity.releaseTime = releaseTime;
	}
	final String? status = jsonConvert.convert<String>(json['status']);
	if (status != null) {
		demandEntity.status = status;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		demandEntity.title = title;
	}
	final String? type = jsonConvert.convert<String>(json['type']);
	if (type != null) {
		demandEntity.type = type;
	}
	final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
	if (updateTime != null) {
		demandEntity.updateTime = updateTime;
	}
	final List<DemandVideos>? videos = jsonConvert.convertListNotNull<DemandVideos>(json['videos']);
	if (videos != null) {
		demandEntity.videos = videos;
	}
	final int? views = jsonConvert.convert<int>(json['views']);
	if (views != null) {
		demandEntity.views = views;
	}
	return demandEntity;
}

Map<String, dynamic> $DemandEntityToJson(DemandEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['bids'] = entity.bids;
	data['circleVo'] = entity.circleVo.toJson();
	data['closeTime'] = entity.closeTime;
	data['collections'] = entity.collections;
	data['completeTime'] = entity.completeTime;
	data['content'] = entity.content;
	data['createTime'] = entity.createTime;
	data['id'] = entity.id;
	data['labels'] =  entity.labels;
	data['lat'] = entity.lat;
	data['likes'] = entity.likes;
	data['lng'] = entity.lng;
	data['loc'] =  entity.loc;
	data['location'] = entity.location;
	data['memberId'] = entity.memberId;
	data['memberInfo'] = entity.memberInfo.toJson();
	data['money'] = entity.money;
	data['number'] = entity.number;
	data['pics'] =  entity.pics;
	data['realDistance'] = entity.realDistance;
	data['releaseTime'] = entity.releaseTime;
	data['status'] = entity.status;
	data['title'] = entity.title;
	data['type'] = entity.type;
	data['updateTime'] = entity.updateTime;
	data['videos'] =  entity.videos.map((v) => v.toJson()).toList();
	data['views'] = entity.views;
	return data;
}

DemandCircleVo $DemandCircleVoFromJson(Map<String, dynamic> json) {
	final DemandCircleVo demandCircleVo = DemandCircleVo();
	final int? adminId = jsonConvert.convert<int>(json['adminId']);
	if (adminId != null) {
		demandCircleVo.adminId = adminId;
	}
	final String? createTime = jsonConvert.convert<String>(json['createTime']);
	if (createTime != null) {
		demandCircleVo.createTime = createTime;
	}
	final String? icon = jsonConvert.convert<String>(json['icon']);
	if (icon != null) {
		demandCircleVo.icon = icon;
	}
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		demandCircleVo.id = id;
	}
	final String? intro = jsonConvert.convert<String>(json['intro']);
	if (intro != null) {
		demandCircleVo.intro = intro;
	}
	final int? memberId = jsonConvert.convert<int>(json['memberId']);
	if (memberId != null) {
		demandCircleVo.memberId = memberId;
	}
	final int? memberNum = jsonConvert.convert<int>(json['memberNum']);
	if (memberNum != null) {
		demandCircleVo.memberNum = memberNum;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		demandCircleVo.name = name;
	}
	final int? sorts = jsonConvert.convert<int>(json['sorts']);
	if (sorts != null) {
		demandCircleVo.sorts = sorts;
	}
	final String? status = jsonConvert.convert<String>(json['status']);
	if (status != null) {
		demandCircleVo.status = status;
	}
	final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
	if (updateTime != null) {
		demandCircleVo.updateTime = updateTime;
	}
	return demandCircleVo;
}

Map<String, dynamic> $DemandCircleVoToJson(DemandCircleVo entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['adminId'] = entity.adminId;
	data['createTime'] = entity.createTime;
	data['icon'] = entity.icon;
	data['id'] = entity.id;
	data['intro'] = entity.intro;
	data['memberId'] = entity.memberId;
	data['memberNum'] = entity.memberNum;
	data['name'] = entity.name;
	data['sorts'] = entity.sorts;
	data['status'] = entity.status;
	data['updateTime'] = entity.updateTime;
	return data;
}

DemandMemberInfo $DemandMemberInfoFromJson(Map<String, dynamic> json) {
	final DemandMemberInfo demandMemberInfo = DemandMemberInfo();
	final String? avatar = jsonConvert.convert<String>(json['avatar']);
	if (avatar != null) {
		demandMemberInfo.avatar = avatar;
	}
	final int? creditScore = jsonConvert.convert<int>(json['creditScore']);
	if (creditScore != null) {
		demandMemberInfo.creditScore = creditScore;
	}
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		demandMemberInfo.id = id;
	}
	final String? intro = jsonConvert.convert<String>(json['intro']);
	if (intro != null) {
		demandMemberInfo.intro = intro;
	}
	final String? nickName = jsonConvert.convert<String>(json['nickName']);
	if (nickName != null) {
		demandMemberInfo.nickName = nickName;
	}
	return demandMemberInfo;
}

Map<String, dynamic> $DemandMemberInfoToJson(DemandMemberInfo entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['avatar'] = entity.avatar;
	data['creditScore'] = entity.creditScore;
	data['id'] = entity.id;
	data['intro'] = entity.intro;
	data['nickName'] = entity.nickName;
	return data;
}

DemandVideos $DemandVideosFromJson(Map<String, dynamic> json) {
	final DemandVideos demandVideos = DemandVideos();
	final String? cover = jsonConvert.convert<String>(json['cover']);
	if (cover != null) {
		demandVideos.cover = cover;
	}
	final String? url = jsonConvert.convert<String>(json['url']);
	if (url != null) {
		demandVideos.url = url;
	}
	return demandVideos;
}

Map<String, dynamic> $DemandVideosToJson(DemandVideos entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['cover'] = entity.cover;
	data['url'] = entity.url;
	return data;
}
